<?php
namespace Orx\Mailer\MailBox\Message;
/**
 * Message Attachements.
 *
 * It represant a log for synchronization
 *
 * @author Xavier VILAIN
 * @package Hive\Message
 * @property int 		$syncid	 	Id of the synchronization
 * @property int		$idusr		User Id
 * @property int	 	$boxid		Box Id
 * @property int	 	$status	 	1 for success and 9 for errors
 * @property datetime 	$sync_date	Synchronization Date
 * @property text	 	$message	Message
 * 
 * @method array box()
 */
class Synchronization extends \Fox\Object {
	
	/**
	 * Link to Mailbox
	 * @var string
	 */
	const LINK_BOX = 'box';
	
	/**
	 * Check if the sync was on error
	 * @return bool
	 */
	public function inError() {
		if($this->status == 9) {
			return true;
		}
		return false;
	}
}
\Fox\Dao::infos(Synchronization::className(),new \Fox\Object\Info('message_synchronizations', \Fox\Databases::DB_APP));